<?php


declare (strict_types = 1);

namespace app\admin\middleware;

class Auth
{
    /**
     *
     *
     * @param \think\Request $request
     * @param \Closure       $next
     * @return Response
     */
    public function handle($request, \Closure $next)
    {
        // 添加前置中间件执行代码
        if(is_login()==false){
            caozha_error("您未登陆后台，请登陆后再操作。",url("admin/index/login"),1,1);
        }

        $response =  $next($request);

        // 添加后置中间件执行代码

        return $response;
    }

    public function end(\think\Response $response)
    {
    }
}
